package com.los;

import java.util.concurrent.ForkJoinPool;
import java.util.stream.Stream;

/**
 * @program: java8
 * @description: 并行
 * @author: Yujuan
 * @create: 2018-06-30 14:24
 **/
public class ParallelProcessing {
    public static void main(String[] args) {
        System.out.println(Runtime.getRuntime().availableProcessors());
    }


    private static long iterateStream(long n){
       return Stream.iterate(1L,i->i+1).limit(n).reduce(0L,Long::sum);
    }

    private static long normalAdd(long limit){
        long result=0L;
        for (long i=1L;i<limit;i++){
            result+=i;
        }
        return  result;
    }
}
